---
import Layout from "../layouts/Layout.astro";
import Card from "../components/Card.astro";

const getposts = await fetch(`http://localhost:4321/api/blog/posts.json`);
const posts = await getposts.json();
console.log(posts);
---
<Layout title="Symon Locke Games Blog">
  {posts.map(item => {
  return (
    <Card title={item.title} href={`/${item.slug}`} body={item.thumbnail} />
  )
  })}
</Layout>
